package nowcoder.written_examination.baidu;

import java.util.Scanner;

/**
 * @author fance
 * @date 18-7-4 上午4:15
 */
public class MainI {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            int n = scanner.nextInt();
            int t = scanner.nextInt();
            int c = scanner.nextInt();
            int[] a = new int[n];
            for(int i = 0;i < n;i++){
                a[i] = scanner.nextInt();
            }
            int cnt = 0;
            int tmp = 0;
            for (int i = 0; i < c; i++) {
                tmp += a[i];
            }
            if (tmp <= t) {
                cnt++;
            }
            for (int i = c; i < a.length; i++) {
                tmp = tmp + a[i] - a[i - c];
                if (tmp <= t) {
                    cnt++;
                }
            }
            System.out.println(cnt);
        }
    }

/*
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        while(in.hasNext()){
            int n = in.nextInt();
            int maxX = Integer.MIN_VALUE;
            int maxY = Integer.MIN_VALUE;
            int minX = Integer.MAX_VALUE;
            int minY = Integer.MAX_VALUE;
            for(int i = 0;i<n;i++){
                int x = in.nextInt();
                int y = in.nextInt();
                maxX = (int) Math.max(maxX,x);
                maxY = (int) Math.max(maxY,y);
                minX = (int) Math.min(minX,x);
                minY = (int) Math.min(minY,y);
            }
            int side = Math.max((maxX-minX),(maxY-minY));
            System.out.println(side*side);
        }
    }*/
}
